home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PROGEDIT
/
2123.ZIP
/
ADVANCED.HLP
< prev
next >
Wrap
Text File
|
1988-10-22
|
9KB
|
253 lines
Some Advanced Tips On Using WindE
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
To be able to take maximum advantage of
WindE's power, the user should read the WindE
User's Guide from cover to cover. Chapter 3
provides some basic examples on how to use
WindE. This file gives some examples of using
WindE that are not necessarily obvious.
Finding Text
▀▀▀▀▀▀▀ ▀▀▀▀
One of WindE's strongest features is its
ability to find the Selected Text. In all
of the "Point and Shoot" editors we have
compared it to──each required that the user
type in the text to be found (this is tough
when searching for whole paragraphs).
The ability to select text and search for
other occurrences is a quick way to move
around in a file:
■ select some text
■ place the cursor at the beginning of
the file
■ do a find
■ if no other occurrences exist──you are
notified (to get back to the original
text──deselect and do a find)
Comparing Text
▀▀▀▀▀▀▀▀▀ ▀▀▀▀
Find can also be used to compare two blocks
of text:
■ open two files to be compared
■ select one entire file
■ place the cursor at the beginning of
the other file
■ do a find
If the files are equivalent, the selection
will move to the second file.
Swapping Text
▀▀▀▀▀▀▀▀ ▀▀▀▀
There is a simple technique for swapping the
position of two blocks of text:
■ select the first block and delete it
■ select the second block and move it
■ place the cursor at the previous
position of the second block
■ deselect and do a copy
This technique works because the first
deletion leaves the cursor in the correct
position for the move and sets up the find
buffer for the copy. Note: do not forget to
deselect before the copy, since you want to
copy the contents of the find buffer.
Replacing Text
▀▀▀▀▀▀▀▀▀ ▀▀▀▀
Replacing the selection is another one of
those features that does not seem to exist
in other editors, therefore, some comments
may help clarify its use.
First of all──HOW IS THE REPLACE BUFFER
DEFINED? There are three possible ways:
■ deleting a selection erases the
replace buffer
■ copying a selection initializes the
replace buffer to contain a copy of
the selection
■ moving a selection initializes the
replace buffer to contain a copy of
the selection
Typically, if you do not need to do a copy,
the replace buffer is setup by selecting text
and moving it to itself (place the cursor
immediately after, or on the first character
of the selected text and do a move).
HOW DO YOU USE THE REPLACE BUFFER? A common
use is to step through a file using the find
command and then executing replace to replace
each occurrence of the found text. A less
common and often overlooked application is
the ability to select various different text
blocks and replace each of them.
Global Search and Replace
▀▀▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀ ▀▀▀▀▀▀▀
The replace buffer is also used by the global
command. Simply stated, this command does a
series of finds and replaces to automate
global changes. This command is discussed
in detail in the Editing Chapter of the
manual, however, because of the importance
of global, a sample editing session will
be described here.
Global repeats a sequence of finds and
replaces until the Find Delimiter or the end
of the file is reached. Note that the setup
for global will also apply to individual
finds and replaces. The Find Delimiter is a
line that begins with two carets (^^) and
contains no other text.
To illustrate the global function, look for a
filename in the Directory Window called
"global.txt" and edit it. Adjust the window
size and position to allow you to continue
reading this file (to the right of this
window should be fine). After opening the
window, you should see several lines with
the words "sample.txt."
Position the Arrow over the letters "txt" in
the first line and do a Stationary Select.
The letters "txt" should now be selected. Do
a delete. Do a global. Move the Arrow to the
"N" in the dialog box and click any mouse
button to allow the global to run without
user verification. All of the occurrences of
"txt" before the Find Delimiter are deleted.
After the first delete operation, the Find
Buffer contained a copy of "txt" and the
Replace Buffer was erased. When the global
function executed, all occurrences of "txt"
before the Find Delimiter were found and
replaced with nothing. This is referred to
as a "Global Delete."
Select the period at the end of the first
line and delete it. Select the ".txt" at the
end of the last line and do a copy.
Position the Arrow on a blank line or after
one of the lines ending in a period and click
the Right Button to turn off the Selection
(referred to as "Deselection"). Do a global
and respond to the dialog box with a no by
entering an "N" on the keyboard. All of the
periods before the Find Delimiter are
replaced with ".txt". This is referred to as
a "Global Replace." As in the case of the
global delete, the Find Buffer was set up by
the deletion of the period. However, in this
case, the Replace Buffer was initialized by
doing the copy of ".txt". When the global
function executed, all periods before the
Find Delimiter were found and replaced with
".txt".
To illustrate an individual replace, select
one of the lines following the Find Delimiter
and do a replace. The line is replaced with
the contents of the Replace Buffer──".txt".
In the global replace example above, there
was a convenient example of text to copy in
order to set up the Replace Buffer. When
there is not an example of replace text to
copy, type in the replace text after doing
the initial delete and select it. This
replace text will be in the correct position
since the Cursor was positioned at the point
of the deleted text. Do a move and nothing
appears to happen since you are moving to the
current position. This seemingly unnecessary
move sets up the Replace Buffer just as the
copy did in the above example. Deselect and
do the global as before.
To illustrate this, select the first
occurrence of "txt" and delete it. Type in
"TEXT", select the word "TEXT" and do a move.
Deselect, do a global and respond to the
dialog with a yes. Each time ".txt" is
found, it is selected and a Dialog Box
prompts:
Replace? [Y], [N] or [A]bort
Select each of the possible responses, in
order, one at a time and note the result.
The deselection before doing the global is
important to note. If you forget to do the
deselection, global will search for the
Selection instead of the contents of the
Find Buffer. If the circumstances were such
that you wanted WindE to search for the
Selection, then of course, WindE would do
that as well. Indeed, because WindE will use
either the Selection or the Find Buffer and
the Find and Replace Buffers can be setup a
couple of different ways, there are several
ways to setup the global command beyond the
three examples given here.
Global searching and replacing in WindE is
not intuitive to new users. The design
philosophy was to make the setup for this
command as fast and as painless as possible.
Time spent learning to use global will be
repaid many times as you continue to edit
with WindE.
Fast Movement Between Directories
▀▀▀▀ ▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀▀▀
If an application has you constantly moving
between several sub-directories, there is an
easy method for doing this without having to
constantly type in the pathnames or to do
tedious relative movements.
Keep a window open that contains a list of
these pathnames. When you need to move to
the new directory, select the pathname
from the window and execute the directory
command. If you only need to open a single
file within the new directory, keep the
filename as part of the pathname and do an
edit command instead of moving into the
directory.
A common misconception amoung new WindE
users is that the selected pathname has
to be inside of the directory window.
This is not true──WindE does not make any
distinction concerning where the selection
comes from.
Nul Window
▀▀▀▀▀▀▀▀▀▀
The "nul" device provided by DOS can be
opened like a file with WindE. This is
useful as a temporary note pad for entering
search text and other pieces of text that
you do not want to be saved when you do an
exit.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▌PRESS: ALT+B to bury this window▐
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀